import {setServer} from "@/utils/axios";
import {deviceUrl} from "../../../url";
const request = setServer(deviceUrl);

// 查询监控设备
export function getMonitorDevice(query) {
  return request({
    url: '/monitor/list',
    method: 'get',
    params: query
  })
}

// 修改监控设备
export function updateMonitorDevice(query) {
  return request({
    url: '/monitor/',
    method: 'put',
    data:query
  })
}

// 获取监控设备详情
export function getMonitorDetail(id) {
  return request({
    url: '/monitor/'+id,
    method: 'get',
  })
}

// 删除监控设备
export function deleteMonitorDevice(id) {
  return request({
    url: '/monitor/'+id,
    method: 'delete',
  })
}

// 查询小区监控设备
export function getMonitorByBiotopeId(query) {
  return request({
    url: '/monitor/list/biotope-id',
    method: 'get',
    params: query
  })
}

// 查询监控设备
export function getMonitorByDeviceId(query) {
  return request({
    url: '/monitor/list/device-id',
    method: 'get',
    params: query
  })
}

// 查询监控设备
export function getMonitorByStrategyId(query) {
  return request({
    url: '/monitor/list/strategy-id',
    method: 'get',
    params: query
  })
}


// 小区绑定监控设备
export function biotopeBindMonitorDevice(query) {
  return request({
    url: '/monitor/bind-monitor',
    method: 'put',
    params: query
  })
}

// 查询监控路径
export function getMonitorUrl(query) {
  return request({
    url: '/monitor/get-url',
    method: 'get',
    params: query
  })
}

// 一键绑定/清空
export function changeMonitorStatus(query) {
  return request({
    url: '/monitor/clear-bind',
    method: 'put',
    params: query
  })
}

// 监控绑定策略
export function monitorBindStrategy(query) {
  return request({
    url: '/monitor/bind-strategy',
    method: 'get',
    params: query
  })
}

// 查询大屏绑定的监控设备id
export function getMonitorIds() {
  return request({
    url: '/monitor/list/has-deleted',
    method: 'get',
  })
}

// 查询大屏推送监控设备
export function getSocketMonitor() {
  return request({
    url: '/monitor/bind-device',
    method: 'get',
    params: query
  })
}

// 获取用户已绑定的监控设备
export function getMonitorByUserId(data) {
  return request({
    url: '/monitor/list-userid',
    method: 'get',
    params: data
  })
}
